﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CslaHispano.EncapsulatedInvoke.Domain.Core;

namespace CslaHispano.EncapsulatedInvoke.Domain.Entities
{
    public partial class SystemEdit
    {
        #region Business Methods

        // TODO: add public properties and methods

        #endregion

        #region Validation Rules

        protected override void AddBusinessRules()
        {
            base.AddBusinessRules();
            BusinessRules.AddRule(new CustomIsNumericRule(CodeProperty));
            BusinessRules.AddRule(new Csla.Rules.CommonRules.Required(TagProperty));
            BusinessRules.AddRule(new Csla.Rules.CommonRules.Required(CodeProperty));
            BusinessRules.AddRule(new Csla.Rules.CommonRules.Required(DescriptionProperty));
            BusinessRules.AddRule(new Csla.Rules.CommonRules.MaxLength(CodeProperty, 50));
            BusinessRules.AddRule(new Csla.Rules.CommonRules.MaxLength(DescriptionProperty, 250));
        }

        #endregion

        #region Authorization Rules

        private static void AddObjectAuthorizationRules()
        {
            // TODO: add object-level authorization rules
        }

        #endregion
    }
}
